package com.cj.designpattern.adapter.common;

import com.cj.designpattern.adapter.common.IVoltage5;

/**
 * ClassName: Mobile <br/>
 * Function: 手机 <br/>
 * date: 2018/04/28 9:25 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public class Mobile {

    /**
     * 手机充电，需要5V电源
     *
     * @param voltage5
     */
    public void charging(IVoltage5 voltage5) {
        if (voltage5.outPut5V() == 5) {
            System.out.println("电压刚刚好5V，开始充电");
        } else if (voltage5.outPut5V() > 5) {
            System.out.println("电压超过5V，不能充电");
        }
    }
}
